package com.emm.yixun.common.model.enums;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

public enum CongShiHangYeEnum implements Serializable{
	GONGYE("1","工业制造",null),
	MAOYI("2","贸易",null),
	NONGLIN("3","农林牧渔",null),
	CAIKUANG("4","采矿业",null),
	JIANZHU("5","建筑业",null),
	FANGDICHAN("6","房地产业",null),
	JINRONG("7","金融业",null),
	JIAOTONG("8","交通运输仓储和邮政业",null),
	IT("9","IT行业（信息传输、计算机服务和软件业）",null),
	JIUDIAN("10","酒店/餐饮业",null),
	ZULING("11","租赁（和商务服务业）",null),
	JIAOYU("12","教育",null),
	YILIAO("13","医疗卫生",null),
	WENHUA("14","文化和体育",null),
	LVYOU("15","旅游",null),
	GONGGONG("16","公共管理（政府机关等）和社会组织",null),
	KEXUE("17","科学研究和技术服务",null),
	GUOJI("18","国际组织",null),
	QITA("19","其他",null),
	;
	
	private final String no;
	private final String des;
	private final Enum parent;
	
	/**
	 * 私有构造函数
	 * @param code
	 * @param description
	 */
	CongShiHangYeEnum(String no, String des,Enum parent) {
		this.no = no;
		this.des = des;
		this.parent = parent;
	}

	/**
	 * @return Returns the no.
	 */
	public String getNo() {
		return no;
	}

	/**
	 * @return Returns the des.
	 */
	public String getDes() {
		return des;
	}
	
	/**
	 * @return Returns the parent.
	 */
	public Enum getParent() {
		return parent;
	}

	/**
	 * 通过枚举<code>des</code>获得枚举
	 * 
	 * @param des
	 * @return
	 */
	public static CongShiHangYeEnum getByDescription(String des) {
		if(StringUtils.isBlank(des)){
			return null;
		}
		for (CongShiHangYeEnum menum : values()) {
			if (menum.getDes().equals(des)) {
				return menum;
			}
		}
		return null;
	}
	public static CongShiHangYeEnum getByNo(String no) {
		if(StringUtils.isBlank(no)){
			return null;
		}
		for (CongShiHangYeEnum menum : values()) {
			if (menum.getNo().equals(no)) {
				return menum;
			}
		}
		return null;
	}
}
